<div class="SipeiInfo pt20">
<?php $form = $this->beginWidget('CActiveForm', array('id' => 'myform', 'htmlOptions'=>array('target'=>'ajax-frame'))); ?>
<table class="fontc_666 height32">
    <tbody>
        <tr height="55">
            <td valign="top" width="125" align="right" class="pr5"><span class="pr5 fontc_orange_red">*</span>用户登录名：</td>
            <td valign="top" width="370" class="formValidator_td">
                <input type="text" name="username" value="" id='username' class="col3 pt5 pr10 pb5 pl10 height20 border_c border_3 fontc_666" />
                <div class="formValidator_tip">
                    <p id="usernameTip" ></p>
                </div>
            </td>
        </tr>
        <tr height="55">
            <td valign="top" align="right" class="pr5"><span class="pr5 fontc_orange_red">*</span>用户密码：</td>
            <td valign="top" class="formValidator_td">
                <input type="password" value="" name="password" id='password'  class="col3 pt5 pr10 pb5 pl10 height20 border_c border_3 fontc_666" />
                <div class="formValidator_tip">
                    <p id="passwordTip" ></p>
                </div>
            </td>
        </tr>
        <tr>
            <td align="right" class="pr5"><span class="pr5 fontc_orange_red">*</span>所属角色：</td>
            <td>            
                <span class="fl standard_select pt5 pr7 pb5 pl3 border_c border_3">
                    <span class="fl select_shelter">
                        <select class="fl fontc_666" name="role">
                            <?php foreach ($role_object as $rVal): ?>
                                <option value="<?php echo $rVal['role_id']; ?>"><?php echo $rVal['role_name']; ?></option>
                            <?php endforeach; ?>
                        </select>
                    </span>
                </span>
            </td>
        </tr>
        <tr>
            <td valign="top" align="right" class="pt10 pr5">所属学校：</td>
            <td valign="top" class="pt10 formValidator_td height20">
                <ul class="OutList">
                <?php foreach ($school_object as $sVal): ?>
                    <li class="fl pt8 pr10 pb5">
                        <input type="checkbox" value="<?php echo $sVal['school_id']; ?>" name="school[]" class="fl checkbox">
                        <span class="fl pl5"><?php echo $sVal['school_name']; ?></span>
                    </li>
                <?php endforeach; ?>
                </ul>
            </td>
        </tr>
        <tr>
            <td valign="top" align="right" class="pt10 pr5">所属科目：</td>
            <td valign="top" class="pt10 formValidator_td height20">
                <ul class="OutList">
                <?php foreach ($subject_object as $sV): ?>
                    <li class="fl pt8 pr10 pb5">
                        <input type="checkbox" value="<?php echo $sV['subject_id']; ?>" name="subject[]" class="fl checkbox" >
                        <span class="fl pl5"><?php echo $sV['subject_name']; ?></span>
                    </li>                    
                <?php endforeach; ?>
                </ul>
                
            </td>
        </tr>
        <tr>
            <td  align="right" valign="top" class="pt10 pr5">是否生效：</td>
            <td class="pt10"><input type="checkbox" name="status" value="" /></td>
        </tr>
        <tr>
            <td align="right" valign="top" class="pt10 pr5">用户描述：</td>
            <td class="pt10">
                <textarea class="col3 pt6 pr10 pb6 pl10 border_c border_3 fontc_666" name="comment"></textarea>
            </td>
        </tr>
        <tr>                    
            <td colspan="2" align="center" class="pt20 pb20">
                <input type="submit" value="保存" class="b_a_n border_3 back_bgfb w80 height32 fontc_FFF fonts_12 mr10 cursor" />
                <input type="button" value="取消" onclick="api.close()" class="b_a_n border_3 back_bgb w80 height32 fontc_FFF fonts_12 cursor" />
            </td>
        </tr>
    </tbody>
</table>
</div>
<?php $this->endWidget(); ?>
<iframe src='' style="display:none" name='ajax-frame'></iframe>
<script>
$(function() {
	$.formValidator.initConfig({formID: "myform", theme: "126", submitOnce: false,
	onError: function(msg, obj, errorlist) {
		$("#errorlist").empty();
		$.map(errorlist, function(msg) {
			$("#errorlist").append("<li>" + msg + "</li>")
		});
		alert(msg);
	},
	ajaxPrompt: '有数据正在异步验证，请稍等...'
	});

	/*科目代码验证*/
	$("#password").formValidator({
		onShowText: "",
		onShow: "",
		onFocus: "",
		onCorrect: "输入正确",
		leftTrim:true,
		rightTrim:true
	}).inputValidator({
		min: 6,
		max: 12,
		onError: "用户密码位数不正确，(应为6-12)"
	});


	/*用户名验证*/
	$("#username").formValidator({
		onShowText: "请输入用户名",
		onShow: "",
		onFocus: "",
		onCorrect: "输入正确",
		leftTrim:true,
		rightTrim:true
	}).inputValidator({
		min: 1,
		onError: "用户名不能为空"
	});

})
</script>
<?php exit; ?>